my=[{'faceId': 'echo',
  'faceRectangle': {'top': 118, 'left': 144, 'width': 88, 'height': 88},
  'faceAttributes': {'smile': 0.813,
   'headPose': {'pitch': -3.4, 'roll': 1.4, 'yaw': 9.4},
   'gender': 'male',
   'age': 19.0,
   'facialHair': {'moustache': 0.1, 'beard': 0.1, 'sideburns': 0.1},
   'glasses': 'NoGlasses',
   'emotion': {'anger': 0.0,
    'contempt': 0.003,
    'disgust': 0.0,
    'fear': 0.0,
    'happiness': 0.813,
    'neutral': 0.184,
    'sadness': 0.0,
    'surprise': 0.0},
   'blur': {'blurLevel': 'low', 'value': 0.21},
   'exposure': {'exposureLevel': 'overExposure', 'value': 0.81},
   'noise': {'noiseLevel': 'low', 'value': 0.01},
   'makeup': {'eyeMakeup': False, 'lipMakeup': False},
   'accessories': [],
   'occlusion': {'foreheadOccluded': False,
    'eyeOccluded': False,
    'mouthOccluded': False},
   'hair': {'bald': 0.18,
    'invisible': False,
    'hairColor': [{'color': 'brown', 'confidence': 0.95},
     {'color': 'black', 'confidence': 0.93},
     {'color': 'other', 'confidence': 0.23},
     {'color': 'blond', 'confidence': 0.23},
     {'color': 'gray', 'confidence': 0.21},
     {'color': 'red', 'confidence': 0.15},
     {'color': 'white', 'confidence': 0.0}]}}},
 {'faceId': 'echo2',
  'faceRectangle': {'top': 117, 'left': 376, 'width': 64, 'height': 64},
  'faceAttributes': {'smile': 0.456,
   'headPose': {'pitch': -1.1, 'roll': -0.2, 'yaw': 6.6},
   'gender': 'female',
   'age': 22.0,
   'facialHair': {'moustache': 0.0, 'beard': 0.0, 'sideburns': 0.0},
   'glasses': 'NoGlasses',
   'emotion': {'anger': 0.0,
    'contempt': 0.001,
    'disgust': 0.0,
    'fear': 0.0,
    'happiness': 0.456,
    'neutral': 0.542,
    'sadness': 0.001,
    'surprise': 0.0},
   'blur': {'blurLevel': 'low', 'value': 0.16},
   'exposure': {'exposureLevel': 'goodExposure', 'value': 0.58},
   'noise': {'noiseLevel': 'low', 'value': 0.01},
   'makeup': {'eyeMakeup': False, 'lipMakeup': True},
   'accessories': [],
   'occlusion': {'foreheadOccluded': False,
    'eyeOccluded': False,
    'mouthOccluded': False},
   'hair': {'bald': 0.08,
    'invisible': False,
    'hairColor': [{'color': 'black', 'confidence': 1.0},
     {'color': 'other', 'confidence': 0.63},
     {'color': 'brown', 'confidence': 0.46},
     {'color': 'gray', 'confidence': 0.39},
     {'color': 'blond', 'confidence': 0.03},
     {'color': 'red', 'confidence': 0.01},
     {'color': 'white', 'confidence': 0.0}]}}},
 {'faceId': 'echo3',
  'faceRectangle': {'top': 41, 'left': 676, 'width': 52, 'height': 52},
  'faceAttributes': {'smile': 1.0,
   'headPose': {'pitch': 3.0, 'roll': -1.3, 'yaw': -0.6},
   'gender': 'male',
   'age': 25.0,
   'facialHair': {'moustache': 0.1, 'beard': 0.1, 'sideburns': 0.1},
   'glasses': 'ReadingGlasses',
   'emotion': {'anger': 0.0,
    'contempt': 0.0,
    'disgust': 0.0,
    'fear': 0.0,
    'happiness': 1.0,
    'neutral': 0.0,
    'sadness': 0.0,
    'surprise': 0.0},
   'blur': {'blurLevel': 'low', 'value': 0.0},
   'exposure': {'exposureLevel': 'goodExposure', 'value': 0.66},
   'noise': {'noiseLevel': 'low', 'value': 0.07},
   'makeup': {'eyeMakeup': False, 'lipMakeup': False},
   'accessories': [{'type': 'glasses', 'confidence': 1.0}],
   'occlusion': {'foreheadOccluded': False,
    'eyeOccluded': False,
    'mouthOccluded': False},
   'hair': {'bald': 0.06,
    'invisible': False,
    'hairColor': [{'color': 'black', 'confidence': 0.98},
     {'color': 'brown', 'confidence': 0.96},
     {'color': 'other', 'confidence': 0.22},
     {'color': 'gray', 'confidence': 0.21},
     {'color': 'red', 'confidence': 0.09},
     {'color': 'blond', 'confidence': 0.08},
     {'color': 'white', 'confidence': 0.0}]}}},
 {'faceId': 'echo4',
  'faceRectangle': {'top': 69, 'left': 445, 'width': 52, 'height': 52},
  'faceAttributes': {'smile': 1.0,
   'headPose': {'pitch': 0.2, 'roll': 2.6, 'yaw': 1.5},
   'gender': 'female',
   'age': 23.0,
   'facialHair': {'moustache': 0.0, 'beard': 0.0, 'sideburns': 0.0},
   'glasses': 'NoGlasses',
   'emotion': {'anger': 0.0,
    'contempt': 0.0,
    'disgust': 0.0,
    'fear': 0.0,
    'happiness': 1.0,
    'neutral': 0.0,
    'sadness': 0.0,
    'surprise': 0.0},
   'blur': {'blurLevel': 'low', 'value': 0.0},
   'exposure': {'exposureLevel': 'goodExposure', 'value': 0.56},
   'noise': {'noiseLevel': 'medium', 'value': 0.33},
   'makeup': {'eyeMakeup': False, 'lipMakeup': False},
   'accessories': [],
   'occlusion': {'foreheadOccluded': False,
    'eyeOccluded': False,
    'mouthOccluded': False},
   'hair': {'bald': 0.11,
    'invisible': False,
    'hairColor': [{'color': 'black', 'confidence': 1.0},
     {'color': 'brown', 'confidence': 0.81},
     {'color': 'other', 'confidence': 0.41},
     {'color': 'gray', 'confidence': 0.37},
     {'color': 'blond', 'confidence': 0.03},
     {'color': 'red', 'confidence': 0.02},
     {'color': 'white', 'confidence': 0.0}]}}},
 {'faceId': 'echo5',
  'faceRectangle': {'top': 95, 'left': 238, 'width': 51, 'height': 51},
  'faceAttributes': {'smile': 0.981,
   'headPose': {'pitch': 7.2, 'roll': 1.2, 'yaw': 2.6},
   'gender': 'female',
   'age': 18.0,
   'facialHair': {'moustache': 0.0, 'beard': 0.0, 'sideburns': 0.0},
   'glasses': 'ReadingGlasses',
   'emotion': {'anger': 0.0,
    'contempt': 0.0,
    'disgust': 0.0,
    'fear': 0.0,
    'happiness': 0.981,
    'neutral': 0.019,
    'sadness': 0.0,
    'surprise': 0.0},
   'blur': {'blurLevel': 'low', 'value': 0.07},
   'exposure': {'exposureLevel': 'goodExposure', 'value': 0.69},
   'noise': {'noiseLevel': 'medium', 'value': 0.48},
   'makeup': {'eyeMakeup': False, 'lipMakeup': False},
   'accessories': [{'type': 'glasses', 'confidence': 1.0}],
   'occlusion': {'foreheadOccluded': False,
    'eyeOccluded': False,
    'mouthOccluded': False},
   'hair': {'bald': 0.11,
    'invisible': False,
    'hairColor': [{'color': 'black', 'confidence': 0.98},
     {'color': 'brown', 'confidence': 0.86},
     {'color': 'other', 'confidence': 0.4},
     {'color': 'gray', 'confidence': 0.36},
     {'color': 'blond', 'confidence': 0.09},
     {'color': 'red', 'confidence': 0.08},
     {'color': 'white', 'confidence': 0.0}]}}},
 {'faceId': 'echo6',
  'faceRectangle': {'top': 94, 'left': 540, 'width': 48, 'height': 48},
  'faceAttributes': {'smile': 1.0,
   'headPose': {'pitch': -7.7, 'roll': 5.0, 'yaw': 6.9},
   'gender': 'female',
   'age': 19.0,
   'facialHair': {'moustache': 0.0, 'beard': 0.0, 'sideburns': 0.0},
   'glasses': 'NoGlasses',
   'emotion': {'anger': 0.0,
    'contempt': 0.0,
    'disgust': 0.0,
    'fear': 0.0,
    'happiness': 1.0,
    'neutral': 0.0,
    'sadness': 0.0,
    'surprise': 0.0},
   'blur': {'blurLevel': 'low', 'value': 0.08},
   'exposure': {'exposureLevel': 'goodExposure', 'value': 0.65},
   'noise': {'noiseLevel': 'low', 'value': 0.08},
   'makeup': {'eyeMakeup': False, 'lipMakeup': False},
   'accessories': [],
   'occlusion': {'foreheadOccluded': False,
    'eyeOccluded': False,
    'mouthOccluded': False},
   'hair': {'bald': 0.1,
    'invisible': False,
    'hairColor': [{'color': 'black', 'confidence': 1.0},
     {'color': 'brown', 'confidence': 0.88},
     {'color': 'other', 'confidence': 0.35},
     {'color': 'gray', 'confidence': 0.33},
     {'color': 'blond', 'confidence': 0.05},
     {'color': 'red', 'confidence': 0.04},
     {'color': 'white', 'confidence': 0.0}]}}}]
#先创建一个字典存在眼镜、肤色、微笑指数、头发颜色、年龄、性别

#建一个寒素
#再建一个字典输入进去，
#列表存取


list1 = []
a=my[0]['faceAttributes']['gender']#性别
b=my[0]['faceAttributes']['age']#年龄
c=my[0]['faceAttributes']['smile']#微笑指数
d=my[0]['faceAttributes']['glasses']#是否带眼镜
f=my[0]['faceAttributes']['hair']['hairColor'][0]['color']#头发颜色
list1.append(a)
list1.append(b)
list1.append(c)
list1.append(d)
list1.append(f)
seq = ('echo1', 'echo2', 'echo3','echo4','echo5')
dict = dict.fromkeys(seq)
#print(list1)
dict['echo1']= list1
#print(dict)
list2 = []
a1=my[1]['faceAttributes']['gender']#性别
b2=my[1]['faceAttributes']['age']#年龄
c3=my[1]['faceAttributes']['smile']#微笑指数
d4=my[1]['faceAttributes']['glasses']#是否带眼镜
f5=my[1]['faceAttributes']['hair']['hairColor'][0]['color']#头发颜色
list2.append(a1)
list2.append(b2)
list2.append(c3)
list2.append(d4)
list2.append(f5)
#print(list2)
dict['echo2']= list2
#print(dict)
list3 = []
a1=my[2]['faceAttributes']['gender']#性别
b2=my[2]['faceAttributes']['age']#年龄
c3=my[2]['faceAttributes']['smile']#微笑指数
d4=my[2]['faceAttributes']['glasses']#是否带眼镜
f5=my[2]['faceAttributes']['hair']['hairColor'][0]['color']#头发颜色
list3.append(a1)
list3.append(b2)
list3.append(c3)
list3.append(d4)
list3.append(f5)
#print(list3)
dict['echo3']= list3
#print(dict)
list4 = []
a11=my[3]['faceAttributes']['gender']#性别
b22=my[3]['faceAttributes']['age']#年龄
c33=my[3]['faceAttributes']['smile']#微笑指数
d44=my[3]['faceAttributes']['glasses']#是否带眼镜
f55=my[3]['faceAttributes']['hair']['hairColor'][0]['color']#头发颜色
list4.append(a1)
list4.append(b2)
list4.append(c3)
list4.append(d4)
list4.append(f5)
#print(list4)
dict['echo4']= list4
#print(dict)
list5 = []
a111=my[4]['faceAttributes']['gender']#性别
b222=my[4]['faceAttributes']['age']#年龄
c333=my[4]['faceAttributes']['smile']#微笑指数
d444=my[4]['faceAttributes']['glasses']#是否带眼镜
f555=my[4]['faceAttributes']['hair']['hairColor'][0]['color']#头发颜色
list5.append(a111)
list5.append(b222)
list5.append(c333)
list5.append(d444)
list5.append(f555)
#print(list5)
dict['echo5']= list5
print(dict)

